Sieve + Cycles
Inclusion-Exclusion
Sieve Formula, or Principle of Inclusion-Exclusion
Let be finite sets. Then
where ranges over all -element subsets of .
Proof
Notice that an element not in is not counted in any term on the right-hand side. Thus we only have to show that each element of is counted exactly once on the right-hand side. To do that, pick any element . Let be the set of indices so that if and only if , and let . Note that . As only if , a -fold intersection cannot contain unless . So when determining the number of times is counted by the right-hand side, we only have to consider the intersections involving the which are indexed by . On the other hand, each of these intersections does contain . Therefore, the right-hand side counts once for each of these subsets, with alternating signs. So altogether, the right-hand side counts the element
times. To see that the left-hand side is indeed , subtract from both sides, then multiply both sides by , to get
which is true by the Binomial theorem.
Theorem 2
For all positive integers and , the equality
holds.
Proof
Instead of finding a formula for , we will find a formula for . The latter is the number of all surjections from to .
It is clear that the number of all functions from to is as any element of the domain can be mapped into one of elements. However, not all these functions will be surjections; many will miss one, two, or more elements of in their image. We have to enumerate those that do not miss any element of . This sounds a little bit similar to the previous problem (there we were also interested in the number of certain objects no part of which had a certain property). It is therefore hopeful that the same approach will work here.
Let and let denote the set of all functions from to whose image does not contain . It is then clear that as such functions can map any element of into any one of elements. Similarly,
for all . Therefore, the sieve formula yields:
This is the number of functions from to whose range is not the entire set . So the number of those with range , in other words, the number of surjections, can be obtained by subtracting this number from that of all functions from to , and our claim follows.
Theorem 3
Let and be functions that are defined on the subsets of , and whose range is the set of real numbers. Let us assume that and are connected by
Then
Proof
If we express by values of on the right-hand side, we see that for all , the value will appear once for each set satisfying . Each such appearance of will be counted with a sign given by . The number of such subsets for which is equal to , since is determined by the elements of that are not in , and contains .
Therefore, will appear on the right-hand side exactly times. This number is always zero, except when , that is, when . So the only term on the right-hand side that does not cancel out will be , and the claim is proved.
Cycles in Permutations
Lemma 1
Let be a permutation, and let . Then there exists a positive integer so that .
Proof
Consider the entries . If none of them is equal to , then the Pigeon-hole Principle implies that there are two of them that are equal, say , with . Then, applying to both sides of this equation, we get . Repeating this step, we get , and repeating this step more times, we get .
Let be a permutation. Let , and let be the smallest positive integer so that . Then we say that the entries form an -cycle in .
Corollary
All permutations can be decomposed into the disjoint unions of their cycles.
Proof
Lemma above shows that each entry is a member of a cycle. By the definition of cycles, distinct cycles are disjoint.
The number of -permutations with cycles is called a signless Stirling number of the first kind, and is denoted by . The number is called a Stirling number of the first kind.
Theorem 1
Let and be positive integers satisfying . Then
Proof
We show that the right-hand side counts all -permutations with cycles, just as the left-hand side. In such a permutation, there are two possibilities for the position of the entry .
- The entry can form a cycle by itself, and then the remaining entries have to form cycles. This can happen in ways, so the first member of the right-hand side enumerates these permutations.
- If the entry does not form a cycle by itself, then the remaining entries must form cycles, and then the entry has to be inserted somehow into one of these cycles. The cycles can be formed in ways, then the entry can be inserted in any of these cycles, after each element. This multiplies the number of possibilities by , and explains the second term of the right-hand side.
Lemma 2
Let be a fixed positive integer. Then
Proof
We prove that the coefficients of on the right-hand side also satisfy the recurrence relation (Theorem 1) that is satisfied by the signless Stirling numbers of the first kind. Let . Then
We have just proved that
In other words, we proved that two polynomials were identical. The only way that can happen is when the coefficients of the corresponding terms agree in the two polynomials. That is, the equality
must hold for all positive integers and such that . Therefore, the numbers and do satisfy the same recurrence relation. As their initial terms trivially agree, that is, if , this implies that .